package com.liciecruzadinha.app;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ImageView;
import android.widget.TextView;


public class DicaActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_dica);

        Intent intent = getIntent();
        Bundle params = intent.getExtras();
        TextView tv = (TextView)findViewById(R.id.dica);
        ImageView iv = (ImageView)findViewById(R.id.imageView);

        switch (params.getInt("id")){
            case R.id.button1:
                tv.setText(R.string.dica1);
                break;
            case R.id.button2:
                tv.setText(R.string.dica2);
                iv.setImageResource(R.drawable.maquilage);
                break;
            case R.id.button3:
                tv.setText(R.string.dica3);
                break;
            case R.id.button4:
                tv.setText(R.string.dica4);
                iv.setImageResource(R.drawable.bagage);
                break;
            case R.id.button5:
                tv.setText(R.string.dica5);
                iv.setImageResource(R.drawable.iodo);
                break;
            case R.id.button6:
                tv.setText(R.string.dica6);
                iv.setImageResource(R.drawable.unnamed);
                break;
            case R.id.button7:
                tv.setText(R.string.dica7);
                iv.setImageResource(R.drawable.gases);
                break;
            case R.id.button8:
                tv.setText(R.string.dica8);
                iv.setImageResource(R.drawable.caviar);
                break;
            case R.id.button9:
                tv.setText(R.string.dica9);
                iv.setImageResource(R.drawable.boro);
                break;
            case R.id.button10:
                tv.setText(R.string.dica10);
                iv.setImageResource(R.drawable.fluor);
                break;
            case R.id.button11:
                tv.setText(R.string.dica11);
                iv.setImageResource(R.drawable.calcio);
                break;
            case R.id.button12:
                tv.setText(R.string.dica12);
                iv.setImageResource(R.drawable.pasteur);
                break;
            case R.id.button13:
                tv.setText(R.string.dica13);
                iv.setImageResource(R.drawable.oxigenio);
                break;


        }
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.dica, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

}
